package scala.swing

class MigPanel extends Panel with LayoutContainer {
  
  import net.miginfocom.swing.MigLayout
  
  def layoutManager = peer.getLayout.asInstanceOf[MigLayout]
  override lazy val peer = new javax.swing.JPanel(new MigLayout) with SuperMixin 
    
  type Constraints = String
//  
  protected def constraintsFor(comp: Component) =
    layoutManager.getComponentConstraints(comp.peer).asInstanceOf[String]
    //wrapPosition(layoutManager.getConstraints(comp.peer).asInstanceOf[String])
  
  protected def areValid(c: Constraints): (Boolean, String) = (true, "")
  protected def add(c: Component, l: Constraints) { peer.add(c.peer, l.toString) }
  protected def add(c: Component) { add(c, "") }
  
}